# -*- coding: utf-8 -*-
from common import orm
from common.utils.types import Enum

SMS_STATUS = Enum({
    "UNMATCH": (0L, u"未匹配"),
    "MATCHED": (1L, u"已匹配"),
})


class Sms(orm.Model):
    """
    银行余额变动短信记录
    """
    __tablename__ = "sms"
    id = orm.Column(orm.Integer, primary_key=True, autoincrement=True)
    out_sms_id = orm.Column(orm.Integer)
    bankcard_name = orm.Column(orm.VARCHAR)
    mch_id = orm.Column(orm.Integer)
    order_id = orm.Column(orm.Integer)
    content = orm.Column(orm.VARCHAR)
    bank = orm.Column(orm.VARCHAR)
    remark = orm.Column(orm.VARCHAR)
    phone = orm.Column(orm.VARCHAR)
    from_phone = orm.Column(orm.VARCHAR)
    amount = orm.Column(orm.FLOAT)
    balance = orm.Column(orm.FLOAT)
    status = orm.Column(orm.SmallInteger, default=0)
    sms_time = orm.Column(orm.DATETIME)
    created_at = orm.Column(orm.DATETIME)
    updated_at = orm.Column(orm.DATETIME)
